XML
Introduction Hello everybody and welcome to the XML Guide. This guide will teach you how to write the XML code for your map. To make it easier to follow and to consult, this guide is divided in three different parts. The first part is an Overview section about what's "the map XML", why you need it if you want to make a map, and how it works. The second part is a quick Tutorial. In that part we will first create the XML for the Classic map. After that,in the third part, the XML Tags Index, we will look more in depth the code structure, understand any single feature currently available and finally we will learn how to use the advanced features like objectives, autodeploy, or killing neutrals, etc. But before to start, a very special "Thank You!" for contributing with the development of this XML Guide goes to OliverFA, MrBenn, ender516, natty dread and the whole Cartographers Team Pretty graphics are not enough to make a successful map. You also need to think up good gameplay rules and write them down in an XML file. This tutorial will explain how to do that. Don't worry, you don't need any technical skills or special software. Just pay attention and fire up your favourite text editor, such as notepad. Header First of all, your XML file must begin with this on the first line: Don't worry about understanding it – it's a special tag that tells the game engine that this is an XML file. The tag encloses all the other information. Everything you write except for the header needs to be inside this tag. Next you need a map tag which will contain everything else. . . . It is customary to indent tags when they are nested inside other tags and put one tag on each line. This isn't necessary but makes your XML easier to read. Tags and comments Map tags Tags, please notice that tags must come in pairs. There is an opening and a closing . They are named the same, except that the closing tag has a slash. Everything between the opening and closing tags is considered to be information describing that element. As an example, most map elements will have sub-tags inside describing their names. Comments A comment is a tag in the style . Although comments are optional, it's a good practice to use comments to structure your code, and also to help understand it and navigate through it. Territories Territories are the basic unit for constructing any map. The map is described by a collection of territories, how they connect to each other, and how they group in continents. Territories always have an owner (even if it's the "neutral" player) and each player needs at least one territory to stay alive. Troops are placed in territories, and battles are fought for the control of such territories. In some parts of Conquer Club, territories are referred to as regions. A territory is described by the tag of the same name, . Nested inside the tag there are other sub-tags that describe all the properties of that territory. Naming a territory We use the tag to name a territory. In this example we will start by the Anchorage city, as it is the first in alphabetic order (this doesn't mean you have to do the same, in fact the game engine lists the territories in alphabetical order in any case). Anchorage Setting coordinates on map How does the CC engine know where to place the armies numbers for each territory? We provide this information via the tag. As you know, there are two sizes for any map. The small size and the large size. For this reason we need to provide the coordinates for both sizes. 30 125 35 145 Borders with other territories Now we have a city in our map. But it is isolated without connections with any other city. To link territories, we use the tag. Inside this tag there will be a sub-tag for each territory that borders the one we are describing. Looking at the image, there are three cities bordering Anchorage. So we place all of them in our code. Edmonton Vancouver Magadan An important thing to remember is that borders are only one way, like adjacencies in a graph. This means that Edmonton, and Magadan also need to have in their own descriptions a withAnchorage. If we linked Anchorage with Edmonton, but forgot linking Edmonton to Anchorage>, we would make it a one way trip. We would be able to go from to , but we would not be able to come back. Coordinates SXCoord: The value of the X Coordinate, in pixels, for the small map. SYCoord: The value of the Y Coordinate, in pixels, for the small map. LXCoord: The value of the X Coordinate, in pixels, for the large map. LYCoord: The value of the Y Coordinate, in pixels, for the large map. Territory Summary This is how it looks when we put everything together(keep in mind code order as it is important): Anchorage Edmonton Vancouver Magadan 30 125 35 145 Continents Continents are groups of territories that provide an extra bonus when held together at the beginning of a turn. In the Classic map Africa is a continent, but America is divided in two continents (North America andSouth America). We describe continents in our XML file by using the tag. Notice that depending on the map theme, "Continents" could be something different from the geographical continents. They could be other zones of the map that share something in common. For this reason they are also called bonus zones<. As said, a continent is a group of territories. Similar to what happened with territories, the tag contains other tags nested inside that define the different properties of that bonus region. Naming continents We use the tag to name a continent. The following example is how you would name Africa. Africa Naming continent components Inside the tag we list all the components of that continent. This will tell the engine which territories a player has to own at the beginning of the turn to receive the zone bonus. Let's list the territories that form Africa. Dakar Cairo Nairobi Lagos Cape Town Johannesburg Continent bonus We know how to name continents and how to specify the territories that form that continent. The last thing left is saying how many troops a player receives for holding the continent at the beginning of the turn. We specify that information with the tag. For Africa, the bonus tag looks like this: 3 Continent within continent The 13 Colonies map shows that is possible to use the tag as component. In this case, the 3 bonus troops are awarded if the player holds any 2 of the component continents. ... 2 colonies 3 Georgia South Carolina North Carolina Virginia Maryland Delaware Pennsylvania New Jersey New York Connecticut Rhode Island Massachusetts New Hampshire 2 ... Continent summary Africa 3 Dakar Cairo Nairobi Lagos Cape Town Johannesburg Minimum reinforcements Adjusts the value of minimum reinforcements for the map. At the beginning of every turn, each player is guaranteed to get at least the number of troops specified in this tag, no matter how many territories or bonuses he has. Syntax Number or troops Number of troops: The minimum of troops we want players to receive at the beginning of each turn. Notes: If this tag is not specified, the map will have a default value of 3 troops minimum. The minimum number of reinforcement troops can't be 0. It has to be at least 1. Location: It goes after the opening tag and before the tag. Example: Imagine we want to eliminate the standard minimum of 3 troops. We can do it by setting the value to 1. (It can't be 0). The City Mogul map does it. 1